﻿<#
.SYNOPSIS  
    Removes SharePoint upgrade log files.  
.DESCRIPTION  
    This script is useful when upgrades are run repeatedly to clean out old upgrade log files.
.NOTES
    Do not run this script if you want to keep upgrade log files.
.LINK  
    http://7up.codeplex.com 
#>

Write-Host ("   Removing upgrade log files ({0})..." -f [DateTime]::Now.ToString())

$config = [xml](Get-Content Upgrade.xml)

Write-Host ("      Log file path: '{0}' ({1})..." -f $config.Settings.UpgradeLogFilePath, [DateTime]::Now.ToString())

Get-ChildItem -Path $config.Settings.UpgradeLogFilePath -Filter "Upgrade-*" | Remove-Item